import { request } from '@/utils/request';

export function getProductList(data) {
  return request({
    url: '/queue/enter-product/enter-purchase-products-page',
    headers: {
      isToken: false
    },
    method: 'GET',
    data: data
  });
}
//
export function getSupProductList(data) {
  return request({
    url: '/queue/enter-product/enter-purchase-product-suppliers-page',
    headers: {
      isToken: false
    },
    method: 'GET',
    data: data
  });
}

export function createProduct(data) {
  return request({
    url: '/queue/enter-product/create',
    headers: {
      isToken: false
    },
    method: 'POST',
    data: data
  });
}
export function createPurProduct(data) {
  return request({
    url: '/queue/enter-product/purchase-coal-pro-sup-add',
    headers: {
      isToken: false
    },
    method: 'POST',
    data: data
  });
}
export function reportProduct(id) {
  return request({
    url: `/queue/supplier-product/report-energy/${id}`,
    headers: {
      isToken: false
    },
    method: 'POST'
  });
}
export function updateProduct(data) {
  return request({
    url: '/queue/enter-product/update',
    headers: {
      isToken: false
    },
    method: 'PUT',
    data: data
  });
}

export function getProductById(data) {
  return request({
    url: '/queue/enter-product/getById',
    headers: {
      isToken: false
    },
    method: 'GET',
    data: data
  });
}

export function deleteProduct(id) {
  return request({
    url: `/queue/enter-product/delete?id=${id}`,
    headers: {
      isToken: false
    },
    method: 'DELETE'
  });
}

export function getProductByEnterId() {
  return request({
    url: '/queue/coal-enter/getProductByEnterId',
    headers: {
      isToken: false
    },
    method: 'GET'
  });
}

export function deleSupProduct(data) {
  return request({
    url: `/queue/enter-product/purchase-coal-pro-sup-delete`,
    data: data,
    method: 'POST'
  });
}
// 获取供应商精简列表
export function getSimpleList() {
  return request({
    url: '/queue/enter-product/get-client-simple-list',
    method: 'GET'
  });
}
// 获取ERP产品列表
export function getErpProductList() {
  return request({
    url: '/queue/enter-product/get-erp-product-list',
    method: 'GET'
  });
}
